// 这里假设已经场景加载完成，场景加载完成才能触发battle-button
// 触发条件：凑齐两个对战者，没有对战正在进行中，玩家是对战者
function shootGameController() {
    let judge = true;
    const info_left = document.querySelector('#id_left');
    const info_right = document.querySelector('#id_right');
    const info_leftValue = info_left.getAttribute('text').value;
    const info_rightValue = info_right.getAttribute('text').value;
    // 说明还没有集齐两个对战者
    if (info_leftValue === 'id_left' || info_rightValue === 'id_right') {
        judge = false;
        return judge;
    }
    console.error('shootGameLock',shootGameLock);
    if (shootGameLock === true) {//游戏已经开始，battle-button被锁住了
        judge = false;
        return judge;
    }

    // 说明玩家不是对战者
    judge = isPlayerJudge(info_leftValue, info_rightValue, localuserId);
    return judge;



}
// 开始射击游戏
function startShootGame() {
    document.dispatchEvent(new KeyboardEvent('keyup', {
        'key': 'Q'
    }));
    // if (shootGameLock === false) {//battle-button未被锁住才能触发生成事件
    //     document.dispatchEvent(new KeyboardEvent('keyup', {
    //         'key': 'Q'
    //     }));
    // }
    // shootGameLock=true;//battle-button本地加锁
    // //battle-button广播加锁信息
    // NAF.connection.broadcastData(dataType_shootGameLock,{shootGameLock:shootGameLock} );

}
